﻿using System.Collections.Generic;
using System.Web.UI.WebControls;
using Trirand.Web.Mvc;

namespace OneDollarStore.Areas.Admin.Models
{
    public class CategoryJqGridModel
    {
        public JQGrid CategoryGrid { get; set; }

        // Constructor
        public CategoryJqGridModel()
        {
            CategoryGrid = new JQGrid
            {
                Columns = new List<JQGridColumn>()
                {
                    new JQGridColumn
                    {
                        DataField = "CategoryID",
                        HeaderText = "ID",
                        Width = 30,
                        Editable = false,
                        Searchable = false,
                        PrimaryKey = true
                    },
                    new JQGridColumn
                    {
                        DataField = "Name",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "Description",
                        Width = 300,
                        Editable = true,
                        EditType = EditType.TextArea,
                        DataType = typeof(string)
                    }
                },
                Width = Unit.Pixel(1060),
                Height = Unit.Pixel(200)
            };
        }
    }
}